/**
 * @title: TestService
 * @projectName demo1
 * @Description TODO
 * @Author
 * @Date 2023/2/19 20:56
 */
package com.example.demo1.service;

import com.example.demo1.entity.StudentDO;
import com.example.demo1.entity.StudentDTO;
import com.example.demo1.mapper.StudentMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestService {
    @Autowired
    StudentMapper studentMapper;
    public StudentDTO getStudent(Integer id) {
        StudentDO studentDO = studentMapper.selectById(id);
        StudentDTO studentDTO = new StudentDTO();
        BeanUtils.copyProperties(studentDO,studentDTO);
        return studentDTO;
    }
}
